import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * 装修师傅信息表
 */
@Entity('biz_worker_list', { comment: '装修师傅信息表' })
export class BizWorkerListEntity extends BaseEntity {
  @Column({
    comment: '状态 0-禁用 1-正常',
    type: 'tinyint',
    default: 0,
  })
  status: number;

  @Column({ comment: '照片', length: 200, default: '' })
  photo: string;
  @Column({ comment: '姓名', length: 50, default: '' })
  name: string;
  @Column({
    comment: '性别 0-女 1-男',
    type: 'tinyint',
  })
  sex: number;
  @Column({ comment: '出生日期', type: 'date' })
  birthDay: Date;

  @Column({
    comment: '工种 0-电工 1-砖工 2-漆工',
    type: 'tinyint',
  })
  workType: number;
  @Column({
    comment: '评级 0-A+ 1-A',
    type: 'tinyint',
    default: 0,
  })
  workLevel: number;

  @Column({
    comment: '服务订单数量',
    default: 0,
  })
  orderNums: number;

  @Column({ comment: '手机号', length: 50, default: '' })
  phone: string;
  @Index({ unique: true })
  @Column({ comment: '小程序账号', length: 100 })
  account: string;
  @Column({ comment: '小程序密码' })
  password: string;

  @Index()
  @Column({
    comment: '微信OpenId 绑定微信账号推送消息',
    length: 50,
    default: '',
  })
  wechatOpenId: string;

  @Column({ comment: '备注', default: '' })
  notes: string;
}
